﻿using ExDUIR.NET.Declaration;
using ExDUIR.NET.Handle;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net.NetworkInformation;
using System.Text;
using System.Threading.Tasks;

namespace ExDUIR.NET.Matrix
{
    public class ExMatrix
    {
        private readonly ExMatrixHandle _handle;
        public bool IsValid => _handle.IsInvalid;
        public IntPtr Handle => _handle.Handle;

        internal ExMatrix(ExMatrixHandle handle)
        {
            _handle = handle;
        }

        internal ExMatrix()
        {
            _handle = new ExMatrixHandle(ExAPI._matrix_create());
        }

        public bool Reset() => ExAPI._matrix_reset(_handle.Handle);

        public bool Rotate(float fAngle) => ExAPI._matrix_rotate(_handle.Handle, fAngle);

        public bool Scale(float scaleX, float scaleY) => ExAPI._matrix_scale(_handle.Handle, scaleX, scaleY);

        public bool Translate(float offsetX, float offsetY) => ExAPI._matrix_translate(_handle.Handle, offsetX, offsetY);

        public void Dispose() => _handle.Dispose();
    }
}
